
#include <cegfx/cesector.h>


ceSector::ceSector ()
	: ceNodeCollection()
{
}

ceSector::~ceSector ()
{
}

IQF_IMPLEMENTATION_BEGIN(ceSector);
// IQF_IMPLEMENTATION_INTERFACE(iDynamicContent);
IQF_IMPLEMENTATION_END();


void ceSector::AddNode (ceNodePtr node)
{
	// check if the node is a light... 
	// if it is a light put, it into the list of lights
	if (node->GetNodeType () != ceNode::NT_LightNode)
	{
		// else delegate further to the node collection
		ceNodeCollection::AddNode (node);
	}
	else
	{
		lights.push_back (node);
	}
}

void ceSector::RemoveNode (ceNodePtr node)
{
	if (node->GetNodeType () != ceNode::NT_LightNode)
	{
		ceNodeCollection::RemoveNode (node);
	}
	else
	{
		ceNodeVector::iterator it;
		for (it = lights.begin (); it != lights.end (); it++)
		{
			if (*it == node)
			{
				lights.erase (it);
				return;
			}
		}
	}
}

